import Vue from 'vue'
import App from './App.vue'
import 'amfe-flexible'
import router from './routers/index.js';
import store from './vuex/store';
import moment from 'moment';

// import './assets/style/resets.css';
import '@/assets/style/resets.css'
import'@/assets/style/global.css'

import VueRouter from "vue-router";

// VueRouter  3版本之后的都是 升级后变为了promise对象，重复点击路由报错 push replace
// 统一处理catch
const originPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location,onResolve,onReject){
  if(onResolve || onReject) return originPush.call(this,location,onResolve,onReject)
  return originPush.call(this,location).catch(err=>err);
}

const originReplace = VueRouter.prototype.replace;
VueRouter.prototype.replace = function replace(location,onResolve,onReject){
  if(onResolve || onReject) return originReplace.call(this,location,onResolve,onReject)
  return originReplace.call(this,location).catch(err=>err);
}

// Vue.prototypr.$message = Message;
Vue.prototype.$moment = moment;
Vue.config.productionTip = false
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

//面包屑导航
import BreadCrumb from'@/components/commons/BreadCrumb.vue'

Vue.use(ElementUI);

Vue.component("BreadCrumb",BreadCrumb);



new Vue({
  router,
  store,
  BreadCrumb,
  render: h => h(App),
}).$mount('#app')
